﻿using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;

namespace PipelineDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            var app = new MyApplicationBuilder();


            app.Use(async (context, next) =>
            {
                Console.WriteLine("一号中间件启动");
                await next();
                Console.WriteLine("一号中间件结束");
            });

            app.Use(async (context, next) =>
            {
                Console.WriteLine("二号中间件启动");
                await next();
                Console.WriteLine("二号中间件结束");
            });
            var middlewear = app.Build();
            middlewear(new MyHttpContext());

        }
    }
}
